package Gameplay.Weapon;

import java.util.ArrayList;

import ADTs.PointADT;
import Gameplay.Level;
import Gameplay.Projectile.Projectile;
import Gameplay.Projectile.Projectile1;
import Project.Main;

/**
 * This class is to change different status of 
 * weapons by changing their details such as
 * damageMake, cool-down time and speed.
 * 
 * @author	Brian Wetherbee
 * 			Ryan McNamara
 * 			Zeng Yang
 *
 */
public class Weapon0 extends Weapon {

	public Weapon0(ArrayList<Integer> weaponLevel, boolean friendly) {
		super(weaponLevel, friendly, "Awso-Gun");
	}
	
	public void fire(PointADT dest,PointADT loc){
		if (checkCooldown(true)) {
			double speed = getSpeed();
			double damage = getDamage();
			System.out.println("Speed + Damage: " + speed + " " + damage);
			((Level) Main.getCurrentUI()).addToState(new Projectile1(dest, loc, new PointADT(0,0), speed, damage, true));
		}
	}
	
	//Different damage levels
	public double getDamage() {
		if(getWeaponLevel().get(2) == 0) {
			return 3;
		} else if(getWeaponLevel().get(2) == 1) {
			return 5;
		} else if(getWeaponLevel().get(2) == 2) {
			return 7;
		} else if(getWeaponLevel().get(2) == 3) {
			return 9;
		} else if(getWeaponLevel().get(2) == 4) {
			return 11;
		}
		return 15;
	}

	//Different cool-down time levels
	public long getCooldownTime() {
		if(getWeaponLevel().get(1) == 0) {
			return 300;
		} else if(getWeaponLevel().get(1) == 1) {
			return 265;
		} else if(getWeaponLevel().get(1) == 2) {
			return 230;
		} else if(getWeaponLevel().get(1) == 3) {
			return 195;
		} else if(getWeaponLevel().get(1) == 4) {
			return 160;
		}
		return 90;
	}

	//Different speed levels
	public double getSpeed() {
		if(getWeaponLevel().get(2) == 0) {
			return 0.9;
		} else if(getWeaponLevel().get(2) == 1) {
			return 1.0;
		} else if(getWeaponLevel().get(2) == 2) {
			return 1.1;
		} else if(getWeaponLevel().get(2) == 3) {
			return 1.2;
		} else if(getWeaponLevel().get(2) == 4) {
			return 1.3;
		}
		return 1.5;
	}

}
